package com.budwk.app.sms.constants;

import com.budwk.app.sms.vo.SysSmChannelVO;
import com.google.common.collect.Lists;

import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

/**
 * @author ZY.Wang
 * @since 2023/5/31
 */
public class SysSmsConstant {

    /**
     * 腾讯短信发送平台
     */
    public static final String txSms = "txSms";

    /**
     * poa短信发送平台 默认使用poa
     */
    public static final String poaSms = "poaSms";

    /**
     * 默认的发送法师
     */
    public static final String default_sms = poaSms;

    /**
     * 系统当前使用的短信发送平台 redisKey
     */
    public static final String redis_key_sms_channel = "sms_channel";

    /**
     * 新加一种消息发送 只需要在这个类中添加一个
     *
     * @return 消息发送渠道list
     */
    public static List<SysSmChannelVO> getSmsChannel() {
        SysSmChannelVO txSmsVO = new SysSmChannelVO();
        txSmsVO.setChannelCode(txSms);
        txSmsVO.setChannelName("腾讯");

        SysSmChannelVO poaSmsVO = new SysSmChannelVO();
        poaSmsVO.setChannelCode(poaSms);
        poaSmsVO.setChannelName("Poa");

        return Lists.newArrayList(txSmsVO, poaSmsVO);
    }

    public static Set<String> getSmsChannelCodeSet(){
        return getSmsChannel().stream().map(SysSmChannelVO::getChannelCode).collect(Collectors.toSet());
    }
}
